package com.sz.demo.web.controller;

import com.sz.web.model.ApiResponse;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;


/**
 * @author: yxl
 * 2025-07-24
 */

@RestController
public class TestController {

    @GetMapping("/test")
    public String test(){
        throw new RuntimeException("一个错误的例子");
    }

    @GetMapping("/test2")
    public ApiResponse<User> test2(){
        User user = new User();
        user.setName("小红apiResponse");
        user.setTime(new Date());
        user.setTime2(LocalDateTime.now());
        return ApiResponse.success(user);
    }

    @GetMapping("/test3")
    public User test3(){
        User user = new User();
        user.setName("小红apiResponse");
        user.setTime(new Date());
        user.setTime2(LocalDateTime.now());
        return user;
    }

    @GetMapping("/test4")
    public String test4(){
        return "测试4";
    }

    @GetMapping("/test5")
    public void test5(){
        return;
    }







}
